﻿using System;
using Microsoft.AspNet.SignalR;
using Web.Controllers;
using Wombat.WcfClientGate;

namespace Web
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "TagDataBroadcasterService" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select TagDataBroadcasterService.svc or TagDataBroadcasterService.svc.cs at the Solution Explorer and start debugging.
    public class TagDataBroadcasterService : ITagDataBroadcasterService
    {
        public void PublishDouble(Guid tagId, DateTime time, double? value)
        {
            var context = GlobalHost.ConnectionManager.GetHubContext<BroadcastHub>();
            context.Clients.All.updateDouble(tagId, time, value);
        }
    }
}
